package main

import (
	"database/sql"
	"fmt"
	_ "gitee.com/GBase8s/go-gci"
	"log"
)
func main() {
	// 设置DSN
	Gbase8sDSN := "gbase8s://odbc_user:GBase@1234@192.168.3.225:9088/test?GBASEDBTSERVER=gbase01&PROTOCOL=onsoctcp&sqlmode=gbase&delimident=1&GOGCILogTrace=0"

	// 使用 go-gci 连接数据库
	db, err := sql.Open("gbase8s", Gbase8sDSN) 
	if err != nil {
		log.Fatalf("数据库连接失败: %v\n", err)
	}
	defer db.Close()

	// 测试数据库连接
	err = db.Ping()
	if err != nil {
		log.Fatalf("无法连接到数据库: %v\n", err)
	}

	fmt.Println("数据库连接成功！")
}
